﻿#ifndef IMMAINWINDOW_H
#define IMMAINWINDOW_H

#include "mainwindow.h"
#include <QPixmap>
#include <QVariant>

class QSystemTrayIcon;

class IMMainWindow : public MainWindow
{
    Q_OBJECT
public:
    explicit IMMainWindow(QWidget *parent = Q_NULLPTR);
    ~IMMainWindow();
    QWidget *switchCentral(bool chat);    
public slots:
    void drawTrayIcon(bool online);
    void closeCentral();
private slots:
    void slot_im_evnt(int cmd_type, QVariantHash msg);
    void slot_room_evnt(QVariantHash msg);
    void slot_run_updater();
    void slot_system_setting();
protected:
    void closeEvent(QCloseEvent *e);
    void setMaximizeButton(bool isMax);
    bool isTitle(const QPoint& pos) const;
    void handleWindowMinimized();
private:
    void autoCheckUpdates();
    QSystemTrayIcon *trayIcon;
    const QPixmap basicPixmap;
    const QPixmap basicPixmapGray;
};

#endif // IMMAINWINDOW_H
